print("Hello, World!")[1] "Hello, World!"
Before the first lecture, we need to set up your computing environment.
By the end of the lecture, you will be able to …
Hello, World!Learning to write a computer program to print Hello, World! to your screen is often the first thing you learn in programming.
To make sure you are ready use a computer program (R) to work with data, this lab will set you up to use R to print this sentence to your screen.
R: The programming language you’ll learn in this course.
RStudio: The software you’ll use to write R code in.
R is available through the web page of The Comprehensive R Archive Network (CRAN).
The top of the web page provides three links for downloading R. Follow the link that describes your operating system: Windows, Mac, or Linux. Complete instructions area available from rstudio-education, with key steps listed below.
To install R on Windows, click the “Download R for Windows” link.
Then click the “base” link.
Next, click the first link at the top of the new page. This link should say something like “Download R 4.5.1 for Windows.” (Note: 4.5.1 will be replaced by the most current version of R.)
The link downloads an installer program, which installs the most up-to-date version of R for Windows.
Run this program and step through the installation wizard that appears. The wizard will install R into your program files folders and place a shortcut in your Start menu. You’ll need to have all of the appropriate administration privileges to install new software on your machine.
To install R on a Mac, click the “Download R for Mac” link. Next, click on the R-4.5.1 package link (or the package link for the most current release of R). An installer will download to guide you through the installation process. The installer lets you customize your installation, but the defaults will be suitable for most users. If your computer requires a password before installing new progams, you’ll need it here.
After you have installed R, you are ready to begin this section! In your web browser (e.g., Chrome, Safari, Edge), go to: https://posit.co/download/rstudio-desktop/
Since you’ve already installed R, you’re reading for step 2. Click on the “DOWNLOAD RSTUDIO DESKTOP FOR WINDOWS/MAC0S” button. This is a big file, so it may take a few minutes to download. Once it’s downloaded, click on the file to install it.
Once you’ve installed R and RStudio, locate RStudio and open it.
Windows Users: you’ll find RStudio by either using the Windows search bar or clicking on the Windows start button and then typing “RStudio.”
Mac Users: RStudio will can be found in your launchpad, or you can drag and drop it to your applications folder. Click “Open” when asked if you want to open the program that has been downloaded from the internet. If a pop-up asks if you want to install “git” tools, you can click “Cancel” (not necessary for this class).
print()Put your cursor next to the > and type: print("Hello, World!) Then press enter. You should see your sentence appear below it.
print("Hello, World!")[1] "Hello, World!"
Congrats! You’re ready to begin analyzing data!